package com.woniu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.dao.TenancyMapper;
import com.woniu.pojo.Leasefile;
import com.woniu.service.TenancyService;
@Service
public class TenancyServiceImpl implements TenancyService {
	
	@Autowired
	private TenancyMapper tenancyMapper;

	@Override
	public PageInfo<Leasefile> getAllTenancyByPage(int i, Integer length, Leasefile leasefile) {
		PageHelper.startPage(i, length);
		List<Leasefile>list=tenancyMapper.getAllTenancyByPage(leasefile);
		PageInfo<Leasefile> pageInfo = new PageInfo<Leasefile>(list);
		// TODO Auto-generated method stub
		return pageInfo;
	}

	@Override
	public List<Leasefile> getAllTenancy() {
		// TODO Auto-generated method stub
		return tenancyMapper.getAllTenancy();
	}

	@Override
	public void deleteTenancyByid(Integer rf_id) {
		tenancyMapper.updateHouseIdBytenancyid(rf_id);
		// TODO Auto-generated method stub
		tenancyMapper.deleteTenancyByid(rf_id);
	}

	@Override
	public void addTenancy(Leasefile leasefile) {
		// TODO Auto-generated method stub
		tenancyMapper.addTenancy(leasefile);
	}

	@Override
	public Leasefile getUpdateTenancyInfo(Integer rf_id) {
		// TODO Auto-generated method stub
		return tenancyMapper.getUpdateTenancyInfo(rf_id);
	}

	@Override
	public void UpdateTenancyInfo(Leasefile leasefile) {
		// TODO Auto-generated method stub
		tenancyMapper.UpdateTenancyInfo(leasefile);
	}

	@Override
	public void deleteRegisterbooksById(String rf_ids) {
		// TODO Auto-generated method stub
		tenancyMapper.deleteRegisterbooksById(rf_ids);
	} 
	
	
}
